<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_Ticket" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
    <title>更新票务</title>
</head>
<body>
<h2>更新票务</h2>
<%
    if ("post".equalsIgnoreCase(request.getMethod())) {
        String id = request.getParameter("id");
        String oid = request.getParameter("oid");
        String uid = request.getParameter("uid");
        String set = request.getParameter("set");
        String state = request.getParameter("state");

        List<String> updateInput = new ArrayList<>();
        updateInput.add(id);
        updateInput.add(oid);
        updateInput.add(uid);
        updateInput.add(set);
        updateInput.add(state);

        DB_Ticket dbTicket = new DB_Ticket();
        boolean updateResult = dbTicket.update(updateInput);

        if (updateResult) {
            response.sendRedirect("index.jsp");
        } else {
            out.println("更新票务失败");
        }
    }
%>
</body>
</html>